package com.longge;

import java.util.Arrays;

/**
 * @program: my-code
 * @description:
 * @author: longge
 * @create: 2021-06-03 15:09
 */
public class ArrayPairSum {

    public int arrayPairSum(int[] nums) {

        Arrays.sort(nums);
        int count = 0;
        for (int i = 0; i < nums.length; i += 2) {
            count += nums[i + 1];
        }
        return count;
    }
}
